<ui:component xmlns:ui="http://java.sun.com/jsf/facelets"
              xmlns:h="http://java.sun.com/jsf/html"
              xmlns:f="http://java.sun.com/jsf/core"
              xmlns:c="http://java.sun.com/jstl/core"
              xmlns:rich="http://richfaces.org/rich"
              xmlns:a4j="http://richfaces.org/a4j"

        >
    <link rel="stylesheet" type="text/css" href="./style/css/main.css"/>

    <!--@elvariable id="id" type="java.lang.String"-->
    <!--@elvariable id="header" type="java.lang.String"-->
    <!--@elvariable id="reRender" type="java.lang.String"-->
    <!--@elvariable id="bean" type="rs.contacts.core.ui.util.ActionBean"-->
    <!--@elvariable id="oncomplete" type="java.lang.String"-->
    <!--@elvariable id="data" type="java.lang.Object"-->
    <!--@elvariable id="resetButton" type="java.lang.String"-->
     <!--@elvariable id="submitButton" type="java.lang.String"-->
    <rich:modalPanel id="#{id}" moveable="true" resizeable="false" autosized="true" domElementAttachment="parent">
        <f:facet name="header">
            <h:outputText value="#{header}"/>
        </f:facet>
        <f:facet name="controls">
            <h:panelGroup>
                <h:graphicImage value="./style/images/close.PNG" styleClass="hidelink" id="hidelink#{id}"/>
                <rich:componentControl for="#{id}" attachTo="hidelink#{id}" operation="hide" event="onclick"/>
            </h:panelGroup>
        </f:facet>

        <h:form id="#{id}Form">
            <h:panelGroup layout="block">
                <ui:insert name="panelBody"/>
            </h:panelGroup>

            <h:panelGroup styleClass="buttons" layout="block">
                <ui:insert name="actionCommand">
                    <a4j:commandButton id="submitButton"
                                                      type="submit"
                                                      styleClass="button"
                                                      value="#{empty submitButton ? resources.okButton : submitButton}"
                                                      action="#{bean.action}"
                                                      reRender="#{reRender}"
                                                      oncomplete="Richfaces.hideModalPanel('#{id}'); #{oncomplete}"

                                           />
                                   <a4j:commandButton id="resetButton"
                                                      styleClass="button"
                                                      type="reset"
                                                      reRender="#{id}Form"
                                                      value="#{empty resetButton ? resources.cancelButton : resetButton}"
                                                      onclick="if(#{empty resetButton})Richfaces.hideModalPanel('#{id}');this.form.reset(); return false;"/>
                    
                </ui:insert>

              </h:panelGroup>
        </h:form>
    </rich:modalPanel>
</ui:component>